home *** CD-ROM | disk | FTP | other *** search
/ Merciful 2 / Merciful - Disc 2.iso / software / h / hispeedv6.3reg.lha / HiSpeed / arexx / EvenOdd.rexx < prev    next >
OS/2 REXX Batch file  |  1993-05-27  |  2KB  |  86 lines

  1. /* Print either even or odd pages */
  2.  
  3. options results
  4. shell
  5. address HISPEED.1
  6.  
  7. SET REQUESTER ON
  8.  
  9. SET ASK "This macro will print either even or odd pages.|Proceed ?"
  10.  
  11. if RESULT = 1 then 
  12.  
  13.  do
  14.     QUERY JOBS                  /* anything to print ?          */
  15.  
  16.     if RESULT = 0 then
  17.       REQUESTFILE               /* no, ask for files            */
  18.  
  19.     QUERY JOBS                  /* anything to print now ?      */
  20.  
  21.     if (RESULT ~= 0) then       /* let's go ...                 */
  22.  
  23.      do
  24.  
  25.         QUERY PORT              /* remember current output port */
  26.         oldport = RESULT        /* for clean exit               */
  27.  
  28.         QUERY OUTFILE           /* remember current output file */
  29.         oldfile = RESULT        /* for the same reason          */
  30.  
  31.         set PORT FILE           /* set port/file to known state */
  32.         set OUTFILE 'T:PCL'
  33.  
  34.         PRINT                   /* create output (even/odd)     */
  35.  
  36.         do until (choice = 'Q')
  37.  
  38.             say '                                          '
  39.             say ' Options:                                 '
  40.             say ' -----------------------------------------'
  41.             say ' [e] even pages                           '
  42.             say ' [o] odd pages                            '
  43.             say ' [q] quit                                 '
  44.             say '                                          '
  45.             say ' Note: even pages should be printed first.'
  46.             say ''
  47.  
  48.             pull choice
  49.  
  50.             shell
  51.  
  52.             if (choice = 'E') then do
  53.  
  54.                 say ''
  55.                 say ' printing even pages ... please wait'
  56.  
  57.                 if (oldport = 'SER:') then
  58.                     copy 'T:PCL_pass1 SER:'
  59.                 else
  60.                     copy 'T:PCL_pass1 PAR:'
  61.             end
  62.  
  63.             if (choice = 'O') then do
  64.  
  65.                 say ''
  66.                 say ' printing odd pages ... please wait'
  67.  
  68.                 if (oldport = 'SER:') then
  69.                     copy 'T:PCL_pass2 SER:'
  70.                 else
  71.                     copy 'T:PCL_pass2 PAR:'
  72.             end
  73.  
  74.             address HISPEED.1
  75.  
  76.         end
  77.         
  78.         set PORT    oldport     /* restore user's preferences   */
  79.         set OUTFILE oldfile     /* restore user's preferences   */
  80.  
  81.         say ''
  82.         say ' (done - please close window)'
  83.  
  84.      end
  85.  end
  86.